package com.gwtgeo.ui.shared.event;

import org.gwtopenmaps.openlayers.client.layer.Layer;

import com.google.gwt.event.shared.GwtEvent;

public class RepositionLayerEvent extends GwtEvent<RepositionLayerEventHandler>{

	public static Type<RepositionLayerEventHandler> TYPE = new Type<RepositionLayerEventHandler>();

	private Layer layer;
	
	private int index;
	
	public RepositionLayerEvent(Layer layer, int index) {
		super();
		this.layer = layer;
		this.index = index;
	}

	@Override
	protected void dispatch(RepositionLayerEventHandler handler) {
		handler.onRepositionLayer(this);
	}

	@Override
	public Type<RepositionLayerEventHandler> getAssociatedType() {
		return RepositionLayerEvent.TYPE;
	}

	public Layer getLayer() {
		return layer;
	}

	public int getIndex() {
		return index;
	}
}
